{% if board.bo_use_sideview %}
    {% import "/sideview/macros.html" as sideview %}
{% endif %}

{% set thumb_width, thumb_height = 297, 212 %}

<div class="pic_li_lt position-relative col-md-6">
  <div class="d-flex justify-content-between align-items-center mt-3">
    <h2 class="d-block m-0 py-4 fs-3"><a href="{{ url_for('list_post', bo_table=bo_table) }}" class="main-font text-decoration-none fw-bold">{{ board.subject }}</a></h2>
    <a href="{{ url_for('list_post', bo_table=bo_table) }}" class="lt_more" title="更多">
      <span class="blind">{{ board.subject }}</span><i class="fa-solid fa-circle-plus"></i>
    </a>
  </div>
    <ul class="px-2"> 
        {% for write in writes -%}
        <li class="main-bb mb-3 main-font">
            {% if loop.index == 1 %}
            <div class="row rounded-4 card-bg main-border overflow-hidden">
              <a href="{{ url_for('read_post', bo_table=bo_table, wr_id=write.wr_id) }}" class="d-block p-0 col-6" style="height: 300px;">
                  {% set thumbnail=get_list_thumbnail(request, board, write, thumb_width, thumb_height) %}
                  {% if thumbnail.src %}
                  <img src="/{{ thumbnail.src }}" alt="{{ thumbnail.alt }}" class="w-100 h-100 object-fit-cover">
                  {% else %}
                  <img src="{{ theme_asset(request, 'img/no_img.png') }}" alt="没有图像." class="w-100 h-100 object-fit-cover">
                  {% endif %}
              </a>
            {% endif %}
            {% if write.icon_secret -%}
                <i class="fa fa-lock" aria-hidden="true"></i>
                <span class="blind">秘密写作</span>
            {%- endif -%}
            {% if loop.index == 1 %}
            <div class="col-6 p-4">
            {% endif %}
            <a href="{{ url_for('read_post', bo_table=bo_table, wr_id=write.wr_id) }}" class="fs-4 main-font text-decoration-none">
                {% if write.is_notice %}<strong>{{ write.subject }}</strong>{% else %}{{ write.subject }}{% endif %}
            </a>
            {% if write.icon_hot %}<span class="hot_icon"><i class="fa fa-heart" aria-hidden="true"></i><span class="blind">流行写作</span></span>{% endif %}
            {% if write.icon_new %}<span class="new_icon">N<span class="blind">新写作</span></span>{% endif %}
            {% if write.icon_file %}<span class="file_icon"><i class="fa fa-download" aria-hidden="true"></i><span class="blind">文件的附件</span></span>{% endif %}
            {% if write.icon_link %}<span class="link_icon"><i class="fa fa-link" aria-hidden="true"></i><span class="blind">链接</span></span>{% endif %}
            {% if write.icon_reply %}<span class="reply_icon"><i class="fa fa-regular fa-commenting" aria-hidden="true"></i><span class="blind">答案</span></span>{% endif %}
            {% if write.wr_comment %}<span class="lt_cmt"><span class="blind">评论</span>{{ write.wr_comment }}</span>{% endif %}
            <div class="pt-2 pb-3 fs-5 sub-font">
                <span class="lt_nick">
                    {% if board.bo_use_sideview %}
                        {{ sideview.get(request, write.mb_id, write.name, write.wr_email, write.wr_homepage)|safe }}
                    {% else %}
                        <span class="{% if write.mb_id %}member{% else %}guest{% endif %}">
                            {{ write.name }}
                        </span>
                    {% endif %}
                </span>
                <span class="lt_date">{{ write.datetime }}</span>              
            </div>
            {% if loop.index == 1 %}
              </div>
            </div>  
            {% endif %}
        </li>
        {% else -%}
            <li class="empty_li sub-font fs-4" style="padding: 50px 0;">无帖子.</li>
        {%- endfor %}
    </ul>
</div>